URL = 'https://www.iqiyi.com/v_19rrocwwbs.html?eventId=17546abaddbfa6db4329b33993d5c57f&bstp=3&r_originl=2304929100,305458600,101249700&e=17546abaddbfa6db4329b33993d5c57f&stype=2&bkt=9185_A,9184_A,9391_A,9387_B&rseat=image_6&r_area=channel_falls&ht=2&c1=1&r_source=65&recArea=channel_falls&vfrmrst=image_6&bucket=9185_A,9184_A,9391_A,9387_B&vfrmblk=pca_1_waterfall&r=398434500&event_id=17546abaddbfa6db4329b33993d5c57f&rank=6&block=pca_1_waterfall&rpage=pcw_dianying&position=5&vfrm=pcw_dianying'

# 获取字符串长度
URLLEN = len(URL)
print("获取字符串长度 len = %s" % URLLEN)
# 查找内容
RESFIND = URL.find('iqiyi')
print("查找内容的位置是：%s" % RESFIND)
# 判断以XXX开头/结尾 返回布尔
RESSTART = URL.startswith('h')
print("URL是不是开头h是:%s" % RESSTART)
RESEND = URL.endswith('l')
print("URL是不是结尾l是:%s" % RESEND)
# 统计字符出现的次数
RESCOUNT = URL.count('h')
print("统计字符出现的次数 count = %s" % RESCOUNT)
# 字符串替换
RESREPLACE = URL.replace('iqiyi','youku')
print("字符串替换 %s" % RESREPLACE)
# 截取字符串
RESSPLIT = URL.split('?')
print("截取字符串 split = %s" % RESSPLIT)
# 转大写 转小写   --- 验证码
RESUPPER = URL.upper()
print("转大写 %s" % RESUPPER)
RESLOWER = RESUPPER.lower()
print("转小写 %s" % RESLOWER)

USERNAME = " a d m i n "
# 去前后空格
RESSTRIP = USERNAME.strip()
print("去空格前len = %s 去空格后len = %s" % (len(USERNAME),len(RESSTRIP)))


URLHEAD = 'https://www.iqiyi.com/'
URLVIDEO = '【】'
# 字符串拼接
RESJOIN = URLHEAD.join(URLVIDEO)
print("字符串拼接: %s" % RESJOIN)





